﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using LuaFramework;
using LuaInterface;

namespace LuaFramework {
	/// <summary>
	/// 用于Aniamtor动画
	/// </summary>
	public class LuaAnimatorComponent : LuaComponent {

		void OnAnimatorIK(int layer)
		{
			if (!string.IsNullOrEmpty(_name))
			{
				if (!LuaManager.IsInited || _table==null) return;

				LuaFunction func = _table.GetLuaFunction("OnAnimatorIK");
				if (func != null)
				{
					func.Call(_table,layer);
					func.Dispose();
					func = null;
				}
			}
		}

		void OnAnimatorMove(){
			if (!string.IsNullOrEmpty(_name))
			{
				if (!LuaManager.IsInited || _table==null) return;

				LuaFunction func = _table.GetLuaFunction("OnAnimatorMove");
				if (func != null)
				{
					func.Call(_table);
					func.Dispose();
					func = null;
				}
			}
		}
    }
}